home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 May & June / rerun-1986-05-06.d64 / find it (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  179 lines

  1. 5 poke55,0:poke56,32:poke51,0:poke52,32:clr :rem
  2. 10 b1=36864:b2=8192:b3=21760 :rem
  3. 15 forj=b1+7tob1+77:readk:pokej,k:nextj
  4. 20 forj=b1+257tob1+308:readk:pokej,k:nextj
  5. 40 dimc$(16):fr$="n":cr$=chr$(13)
  6. 50 print"[147]":print:printtab(17)"menu":print:print:j=8 :rem
  7. 60 print" 1. find item numbers (screen output)":print :rem
  8. 70 print" 2. find item numbers (print output)":print :rem
  9. 80 print" 3. add items to the list.":print :rem
  10. 90 print" 4. check or change item categories.":print :rem
  11. 100 print" 5. update the disk file.":print :rem
  12. 110 print" 6. create a new disk file.":print :rem
  13. 120 print" 7. end this job.":print:print :rem
  14. 130 printtab(7)"(type 1 - 7  and return)":print :rem
  15. 140 inputj:ifj>7then50
  16. 150 onjgoto290,310,620,710,170,1020
  17. 160 close15:print"[145] all done.":end
  18. 170 print"[147]":print:print:print"updating "+f$+"[146] file."
  19. 180 close6:open6,8,6,"@0:"+f$+",s,w"
  20. 190 print#6,nc;cr$
  21. 200 fori=1tonc:print#6,c$(i);cr$;:nexti
  22. 210 print#6,n;cr$;
  23. 230 forj=1ton:print"";j
  24. 240 n1=peek(b2+j):n2=peek(b3+j)
  25. 260 print#6,n1;cr$;n2;cr$;
  26. 270 next j
  27. 280 close6:goto50
  28. 290 fl$="s":iffr$="n"thengosub1340
  29. 300 goto320
  30. 310 fl$="p":iffr$="n"thengosub1340
  31. 320 print"[147]":print :rem
  32. 330 print" number of items is";n:print :rem
  33. 340 gosub1180:print:print:printtab(5)"(press return key for menu)[145][145][145]" :rem
  34. 345 input" ";q$:gosub1520:ifc=0then50
  35. 350 pokeb1+134,k:pokeb1+133,j:pokeb1+132,k:pokeb1+131,j:print
  36. 360 input"inclusive or exclusive (type i or e)";c$ :rem
  37. 370 ifc$="i"then390
  38. 380 pokeb1+131,255:pokeb1+132,255
  39. 390 print"range of item search? ";:gosub1560 :rem
  40. 400 m=m2+b2+1:k=int(m/256):j=m-256*k:pokeb1+136,k:pokeb1+135,j
  41. 410 m3=m1+b2-1:k=int(m3/256):j=m3-256*k
  42. 420 poke251,j:poke252,k:poke254,k+53 :rem
  43. 430 sys(b1+7)
  44. 440 nn=peek(b1+137):ifnn>0goto460
  45. 450 print"  no such item":goto590
  46. 460 iffl$="p"then520
  47. 470 print"  item numbers are :"
  48. 480 fori=1tonn
  49. 490 j=peek(b1+3584+i)+256*peek(b1+3840+i)-b2
  50. 500 printj;:nexti
  51. 510 goto590
  52. 520 print"  is the printer on? (y or n)
  53. 530 [161]a$:[139]a$[178]""[167]530
  54. 540 [139]a$[178]"n"[167]530
  55. 550 [139]a$[178]"y"[167]570
  56. 560 [137]530
  57. 570 [160]4:    [159]4,4:[152]4,"  item numbers are :"
  58. 580 [152]4:[137]900
  59. 590 [141]820
  60. 600 [139]nn[179][177]255[167]320
  61. 610 j[178][194](b1[170]3839):k[178][194](b1[170]4095):[137]420
  62. 620 [139]fr$[178]"n"[167][141]1340
  63. 630 n[178]n[170]1:[153]"load":[153] :[143]
  64. 640 [139]n[179]13569[167]670 :[143]
  65. 650 [153]"  the file is full. hit shift key to return to menu." :[143]
  66. 660 n[178]n[171]1:[141]830:[137]50
  67. 670 [153]"  next item number is ";n :[143]
  68. 680 [153]:[141]1180
  69. 682 [153]:[153]:[153]:[153][163]5)"(press return key for menu)onononon" :[143]
  70. 685 [133]" ";q$:[141]1520
  71. 690 [139]c[178]0[167]n[178]n[171]1:[137]50
  72. 700 [151]b3[170]n,k:[151]b2[170]n,j:[137]630
  73. 710 [139]fr$[178]"n"[167][141]1340
  74. 720 [153]"load":[153]:[153]:[153] :[143]
  75. 730 [141]1180
  76. 740 [129]i[178]1[164]4:[153]:[130]:[153]"   (for menu type 0 and press return)ononon" :[143]
  77. 745 [133]" item number is ";nn:[139]nn[178]0[167]50
  78. 750 [139]nn[177]n[167]720
  79. 760 [151]251,[194](b2[170]nn)
  80. 770 [151]252,[194](b3[170]nn)
  81. 780 [158](b1[170]257):[153]
  82. 790 [153]"   (inspect and/or alter then return)":[133]"ononononon";q$ :[143]
  83. 800 [141]1520
  84. 810 [151]b3[170]nn,k:[151]b2[170]nn,j:[137]720
  85. 820 [153]:[153]:[153]:[153]"   (press the shift key to continue)" :[143]
  86. 830 [146]653,1
  87. 840 [142]
  88. 900 m[178][181](nn[173]8):r[178]nn[171]8[172]m:[139]m[178]0[167]pr[178][171]8:[137]970
  89. 910 [129]i[178]1[164]m:pr[178]8[172](i[171]1):l$[178]""
  90. 920 [129]k[178]1[164]8:pk[178]pr[170]k
  91. 930 j[178][194](b1[170]3584[170]pk)[170]256[172][194](b1[170]3840[170]pk)[171]b2
  92. 940 j$[178][196](j):l[178][195](j$):l$[178]l$[170]j$[170][200](sp$,6[171]l)
  93. 950 [130]k:[152]4,l$:[130]i
  94. 960 [139]r[178]0[167]1010
  95. 970 l$[178]"":pr[178]pr[170]8:[129]k[178]1[164]r:pk[178]pr[170]k
  96. 980 j[178][194](b1[170]3584[170]pk)[170]256[172][194](b1[170]3840[170]pk)[171]b2
  97. 990 j$[178][196](j):l[178][195](j$):l$[178]l$[170]j$[170][200](sp$,6[171]l)
  98. 1000 [130]k:[152]4,l$
  99. 1010 [160]4:[137]590
  100. 1020 [153]"load":[153]:[133]"name of file";f$
  101. 1030 [153]:[153]"is "f$"wait a new file?close(y or n)"
  102. 1040 [161]a$:[139]a$[178]""[167]1040
  103. 1050 [139]a$[178]"y"[167]1070
  104. 1060 [137] 5
  105. 1070 [153]:[153]" how many categories";:[133]nc
  106. 1080 [129]i[178]1[164]39:[153]"-";:[130]:[153] :[143]
  107. 1090 f[178]0:[129]i[178]1[164]nc
  108. 1100 [153]"category #";i;:[133]c$(i)
  109. 1110 [130]
  110. 1120 [159]6,8,6,"0:"[170]f$[170]",s,w"
  111. 1130 [152]6,nc;cr$;
  112. 1140 [129]i[178]1[164]nc:[152]6,c$(i);cr$;:[130]
  113. 1150 n[178]0:[152]6,n:[160]6
  114. 1160 [153]:[153]"file "f$"wait has been created.
  115. 1170 gosub820:goto50
  116. 1180 printtab(7)"categories":print:print :rem
  117. 1190 ifnc/2=int(nc/2)thenk=int(nc/2):goto1260
  118. 1200 k=int(nc/2)+1
  119. 1210 fori=1tok-1:x=i:gosub1330
  120. 1220 printi$c$(i);tab(19) :rem
  121. 1230 x=i+k:gosub1330:printi$c$(i+k)
  122. 1240 next
  123. 1250 x=k:gosub1330:printi$c$(k):goto1300
  124. 1260 fori=1tok:x=i:gosub1330
  125. 1270 printi$;c$(i);tab(19) :rem
  126. 1280 x=i+k:gosub1330:printi$c$(i+k)
  127. 1290 next
  128. 1300 print"":fori=1to16:print:next :rem
  129. 1305 printtab(21)"1 1 1 1 1 1 1":rem
  130. 1310 printtab(3)"1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6" :rem
  131. 1320 return
  132. 1330 i$=mid$(str$(x),2)+". ":return :rem
  133. 1340 print"[147]":print:print:print:input"name of file";f$
  134. 1350 fr$="y":open15,8,15:open6,8,6,"0:"+f$
  135. 1360 print:print:print"reading "f$"[146] file . . .
  136. 1370 [132]6,nc
  137. 1380 [129]i[178]1[164]nc:[132]6,c$(i):[130]
  138. 1400 [132]6,n
  139. 1410 [139]n[178]0[167]630
  140. 1420 [129]j[178]1[164]n:[153]"";j
  141. 1430 [132]6,n1,n2
  142. 1450 [151]b2[170]j,n1:[151]b3[170]j,n2
  143. 1460 [130]j
  144. 1480 [160]6
  145. 1490 [142]
  146. 1520 c[178]0:[129]i[178]1787[164]1817[169]2 :[143]
  147. 1530 [139][194](i)[178]32[167]1550
  148. 1540 c[178]c[170]2[174]((i[171]1787)[173]2) :[143]
  149. 1550 [130]i:k[178][181](c[173]256):j[178]c[171]256[172]k:[142]
  150. 1560 [161]a$:[139]a$[178]""[167]1560
  151. 1570 [139]a$[178]"a"[167]m1[178]1:m2[178]n:[153]"all":[142]
  152. 1580 [153]a$;
  153. 1590 [161]b$:[139]b$[178]""[167]1590
  154. 1600 [139]b$[178]cr$[167]1630
  155. 1610 [139]b$[178][199](44)[167]m1[178][197](a$):[153]b$;:a$[178]"":[137]1590
  156. 1620 a$[178]a$[170]b$:[153]b$;:[137]1590
  157. 1630 m2[178][197](a$):[153]:[142]
  158. 1660 [131]164,251,169,0,170,133
  159. 1670 [131]251,133,253,200,208,4
  160. 1680 [131]230,252,230,254,204,135
  161. 1690 [131]144,208,11,165,252,205   :[143]
  162. 1700 [131]136,144,208,4,142,137    :[143]
  163. 1705 [131]144,96,177,251,45,131    :[143]
  164. 1710 [131]144,205,133,144,208,223  :[143]
  165. 1715 [131]177,253,45,132,144,205   :[143]
  166. 1720 [131]134,144,208,213,232,208  :[143]
  167. 1725 [131]4,202,76,35,144,152      :[143]
  168. 1730 [131]157,0,158,165,252,157    :[143]
  169. 1735 [131]0,159,76,16,144          :[143]
  170. 1740 [131]169,24,141,255,144,162   :[143]
  171. 1750 [131]0,169,34,133,253,232     :[143]
  172. 1760 [131]232,228,253,208,3,76
  173. 1770 [131]39,145,102,252,102,251   :[143]
  174. 1780 [131]176,3,76,12,145,173      :[143]
  175. 1790 [131]255,144,157,249,6,76     :[143]
  176. 1800 [131]12,145,162,34,169,0      :[143]
  177. 1810 [131]202,240,6,157,249,218    :[143]
  178. 1820 [131]76,43,145,96             :[143]
  179.